import random as r

#随机幸运球1.0
def luckyball():
    flag = r.randint(1,9)
    print(flag)
    ball = []
    for i in range(1,51):
        if i % flag == 0:
            ball.append(i)
    return ball

#随机幸运球2.0
flag2 = r.randint(1, 9)
print(flag2)
ball2 = []
def luckyball_v2():
    for i in range(1, 51):
        if i % flag2 == 0:
            ball2.append(i)
    return ball2
luckyball_v2()
print("幸运球编号为：", ball2)

#随机幸运球3.0
total = 0
flag = r.randint(1, 9)
print(flag)
ball = []
def luckyball_v3():
    global total
    for i in range(1, 51):
        if i % flag == 0:
            ball.append(i)
            total += 1
    return total,ball
luckyball_v3()
print("幸运球个数为",total,"编号为：",ball)
